home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / crtplus.zip / DEMO.PAS < prev   
Pascal/Delphi Source File  |  1990-01-05  |  4KB  |  138 lines

  1. {
  2.     Copyright 1990, John W. Small, All Rights Reserved
  3.     PSW/ Power SoftWare, P.O. Box 10072, McLean, VA 22102 8072
  4.  
  5.     Compile and run this demo with Turbo Pascal 5.5
  6. }
  7. program demo;    { crtplus.pas }
  8.  
  9.     uses crt, crtplus;
  10.  
  11.     var tw : TextWindow;
  12.         ftw : FramedTextWindow;
  13.         stw : ShadowTextWindow;
  14.         i : integer;
  15.         ch : char;
  16.  
  17.     begin
  18.  
  19.         TxtScr.TextMode(co80+font8x8);
  20.  
  21.         crt.DirectVideo := true;
  22.         crt.CheckSnow := true;
  23.  
  24.         TxtScr.SetVideo(BLUE,LIGHTGRAY);
  25.         clrscr;
  26.         writeln('Copyright 1990, John W. Small, All Rights Reserved');
  27.         writeln('PSW / Power SoftWare, P.O. Box 10072, McLean, VA 22102 8072');
  28.         writeln;
  29.         writeln('CrtPlus provides keyboard, cursor, and window enhancements');
  30.         writeln('to Turbo Pascal 5.5''s crt unit.  This demo covers only the');
  31.         writeln('highlights.  For full details read crtplus.pas which');
  32.         writeln('contains the unit''s interface section.  If you send $20');
  33.         writeln('registration fee you will receive source code and manual');
  34.         writeln('on disk.');
  35.         writeln;
  36.         writeln('Press any key to preceed with demo.');
  37.         ch := crtplus.readkey;
  38.  
  39.  
  40.  
  41.         { TextWindow }
  42.  
  43.         tw.window(10,10,50,23);
  44.         TxtScr.SetVideo(WHITE,RED);
  45.         clrscr;
  46.         writeln('This is a TextWindow object.');
  47.         writeln;
  48.         writeln('Example:');
  49.         writeln;
  50.         writeln('   var tw : TextWindow;');
  51.         writeln;
  52.         writeln('   tw.window(10,10,50,23);');
  53.         writeln;
  54.         writeln('   tw.done;');
  55.         ch := crtplus.readkey;
  56.  
  57.  
  58.         { ShadowWindow }
  59.  
  60.         stw.window(5,7,42,20);
  61.         stw.title(TxtScr.svideo(BLUE,RED),' ShadowTextWindow ');
  62.         TxtScr.SetVideo(WHITE,GREEN);
  63.         clrscr;
  64.         writeln;
  65.         writeln('ShadowTextWindow is an object derived from the TextWindow object.');
  66.         writeln;
  67.         writeln('Example:');
  68.         writeln;
  69.         writeln('   var stw : ShadowTextWindow;');
  70.         writeln;
  71.         writeln('   stw.window(5,7,42,20);');
  72.         writeln;
  73.         writeln('   stw.done;');
  74.         ch := crtplus.readkey;
  75.  
  76.  
  77.         { FramedTextWindow }
  78.  
  79.         ftw.window(15,3,70,18);
  80.         ftw.frame(TxtScr.svideo(YELLOW,RED),svsh);
  81.         ftw.titleFooter(true,$4E,'[ FramedTextWindow ]');
  82.         ftw.scrollBar(true,$4E,svsh,2,10);
  83.         ftw.scrollBar(false,$4E,svsh,5,8);
  84.         TxtScr.SetVideo(WHITE,BLUE);
  85.         clrscr;
  86.         writeln('FramedTextWindow is also derived from TextWindow.');
  87.         writeln('It has optional title/footer and scroll bars.');
  88.         writeln;
  89.         writeln('Example:');
  90.         writeln;
  91.         writeln('   var ftw : FramedTextWindow;');
  92.         writeln;
  93.         writeln('   ftw.window(15,3,70,18);');
  94.         writeln;
  95.         writeln('   ftw.done;');
  96.         ch := crtplus.readkey;
  97.  
  98.         { TextScreen }
  99.  
  100.         writeln;
  101.         writeln('var TxtScr : TextScreen; object demo');
  102.         TxtScr.windColor(WHITE,MAGENTA);
  103.         ch := crtplus.readkey;
  104.         TxtScr.windColor(WHITE,CYAN);
  105.         ch := crtplus.readkey;
  106.         ftw.done;
  107.         ch := crtplus.readkey;
  108.  
  109.         stw.done;
  110.         ch := crtplus.readkey;
  111.  
  112.         { CursorShape }
  113.  
  114.         writeln;
  115.         write('var cursor : CursorShape;  object demo: ');
  116.         cursor.block;
  117.         ch := crtplus.readkey;
  118.         cursor.off;
  119.         ch := crtplus.readkey;
  120.         cursor.restore;
  121.         ch := crtplus.readkey;
  122.         tw.done;
  123.  
  124.         writeln;
  125.         TxtScr.SetVideo(WHITE,BLUE);
  126.         writeln('CrtPlus works in all the text modes supported by Turbo Pascal ');
  127.         writeln('including 43/50 line modes!  It also respects the setting of  ');
  128.         writeln('Crt.CheckSnow and Crt.DirectVideo!  The only restriction is   ');
  129.         writeln('that your call TxtScr.TextMode() instead of Crt.TextMode()    ');
  130.         writeln('when changing video modes.  Unlike other windowing tools,     ');
  131.         writeln('CrtPlus extends Turbo Pascal''s form of windows instead of     ');
  132.         writeln('replacing it.  Thus all of Turbo''s window relative routines   ');
  133.         writeln('work as usual in CrtPlus windows.  You can also quickly design');
  134.         writeln('your own style of window as an extension of a CrtPlus window. ');
  135.         ch := crtplus.readkey;
  136.         TxtScr.done;
  137.  
  138. end.